import "@ant-design/v5-patch-for-react-19";
import "./index.css";

import { Suspense } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter, Route, Routes } from "react-router";
import routeConfigs from "./routes/routeConfigs.ts";

// import  LoginPage  from './pages/login/LoginPage.tsx';
// const LoginPage = lazy(() => import('./pages/login/LoginPage.tsx'));
// const RegisterPage = lazy(() => import('./pages/register/Register.tsx'));

createRoot(document.getElementById("root")!).render(
  // <StrictMode>
  <BrowserRouter>
    <Suspense fallback={<span className="loadingSpinner">加载中.....</span>}>
      <Routes>
        {routeConfigs.map(route => (
          <Route
            key={route.path}
            path={route.path}
            element={<route.element />}
          />
        ))}
        {/* <Route path="/login" element={<LoginPage />} />
                <Route path={'/register'} element={<RegisterPage />} />
                <Route
                    path={'/forget-password'}
                    element={<ForgetPasswordPage />}
                /> */}
      </Routes>
    </Suspense>
  </BrowserRouter>
  // </StrictMode>,
);
